package com.kui.trytodo.springmvc.chapter01;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class HelloController {

    @RequestMapping("hello.do")
    public ModelAndView hello() {
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("/views/hello.jsp");
        modelAndView.addObject("message", "Hello World!");
        return modelAndView;
    }
}
